package com.origin.app.page.splash

import androidx.lifecycle.viewModelScope
import com.origin.app.R
import com.origin.app.databinding.ActivitySplashBinding
import com.origin.app.page.company_list.CompanyListActivity
import com.origin.app.page.base.BaseActivity
import com.origin.app.page.location_records.LocationRecordsActivity
import com.origin.app.page.login.LoginActivity
import com.origin.app.page.main.MainViewPagerActivity
import com.origin.app.page.map.AppMapActivity
import com.origin.app.utils.UserInfoUtils
import com.origin.utils.log.LogUtils
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class SplashActivity  : BaseActivity<ActivitySplashBinding, SplashViewModel>(R.layout.activity_splash) {
    override fun initContentView() {
        LogUtils.__e("initContentView  跳转")
        viewModel.viewModelScope.launch {
            delay(1000)
            LogUtils.__e("跳转")
            if(UserInfoUtils.isLogin()){
//                AppMapActivity.launcher()
                MainViewPagerActivity.launcher()
            }else{
                LoginActivity.launcher();
            }
            finish()

        }
    }

}